package autokeyboard.data;

public class KeyConverter
{
	private int counter = 0;
	
	public Object[] converter(String keyName, int delay)
	{
		counter++;
		Object[] item = {counter, convertKeyShow(keyName), convertKeyMask(keyName), delay};
		return item;
	}

	private String convertKeyShow(String keyName)
	{
		switch (keyName)
		{
			case "A":
			case "B":
			case "C":
			case "D":
			case "E":
			case "F":
			case "G":
			case "H":
			case "I":
			case "J":
			case "K":
			case "L":
			case "M":
			case "N":
			case "O":
			case "P":
			case "Q":
			case "R":
			case "S":
			case "T":
			case "U":
			case "W":
			case "V":
			case "X":
			case "Y":
			case "Z":
			{
				return "Key Press Shift + " + keyName;
			}
			case "!":{return "Key Press Shift + 1";}
			case "@":{return "Key Press Shift + 2";}
			case "#":{return "Key Press Shift + 3";}
			case "$":{return "Key Press Shift + 4";}
			case "%":{return "Key Press Shift + 5";}
			case "^":{return "Key Press Shift + 6";}
			case "&":{return "Key Press Shift + 7";}
			case "*":{return "Key Press Shift + 8";}
			case "(":{return "Key Press Shift + 9";}
			case ")":{return "Key Press Shift + 0";}
			case "_":{return "Key Press Shift + MINUS";}
			case "=":{return "Key Press Shift + EQUALS";}
			case "{":{return "Key Press Shift + OPEN BRACKET";}
			case "}":{return "Key Press Shift + CLOSE BRACKET";}
			case ":":{return "Key Press Shift + SEMICOLON";}
			case "\"":{return "Key Press Shift + QUOTE";}
			case "|":{return "Key Press Shift + BACK SLASH";}
			case "<":{return "Key Press Shift + COMMA";}
			case ">":{return "Key Press Shift + PERIOD";}
			case "?":{return "Key Press Shift + SLASH";}
			case "~":{return "Key Press Shift + BACK QUOTE";}
			case " ":{return "Key Press SPACE";}
			case "\n":{return "Key Press ENTER";}
			case "\t":{return "Key Press TAB";}
			case "[":{return "Key Press OPEN BRACKET";}
			case "]":{return "Key Press CLOSE BRACKET";}
			case ";":{return "Key Press SEMICOLON";}
			case "\'":{return "Key Press QUOTE";}
			case "\\":{return "Key Press BACK SLASH";}
			case ",":{return "Key Press COMMA";}
			case ".":{return "Key Press PERIOD";}
			case "/":{return "Key Press SLASH";}
			default:
			{
				return "Key Press " + keyName.toUpperCase();
			}
		}
	}
	
	private String convertKeyMask(String keyName)
	{
		switch (keyName)
		{
			case "\n":{return "Enter";}
			case " ":{return "Space";}
			case "\t":{return "Tab";}
			default:
			{
				return keyName;
			}
		}
	}
}
